home *** CD-ROM | disk | FTP | other *** search
/ MacHack 1998 / MacHack 1998.toast / The Hacks! / PCA Icon Arranger ƒ / Assertions.p next >
Encoding:
Text File  |  1998-06-20  |  1.1 KB  |  71 lines  |  [TEXT/PJMM]

  1. unit Assertions;
  2.  
  3. interface
  4.  
  5. {$IFC UNDEFINED THINK_PASCAL}
  6.     uses
  7.         Types;
  8. {$ENDC}
  9.  
  10. { Useful compile-time variables }
  11.  
  12. { Use threads or not? }
  13. { Threads are broken under Think Pascal 4.02 }
  14. {$setc can_use_threads := true}
  15. {$ifc not undefined THINK_PASCAL}
  16. {$setc can_use_threads := false}
  17. {$endc}
  18.  
  19. {$ifc undefined do_debug}
  20. {$setc do_debug := 1}
  21. {$endc}
  22.  
  23. {$ifc undefined do_showmem}
  24. {$setc do_showmem := 1}
  25. {$endc}
  26.  
  27. {$ifc undefined do_debugfiles}
  28. {$setc do_debugfiles := 1}
  29. {$endc}
  30.  
  31. {$setc do_showmem := 0}
  32. {$setc do_debugfiles := 0}
  33.  
  34. {$ifc not do_debug}
  35. {$definec Assert(b)}
  36. {$elsec}
  37. {$definec Assert(b) AssertCode(b)}
  38. {$endc}
  39.  
  40. {$ifc do_debug}
  41.  
  42. {$ifc do_debugfiles}
  43.     var
  44.         debug1, debug2: Text;
  45. {$endc}
  46.  
  47. {$IFC not undefined THINK_PASCAL}
  48.     procedure Assert (b: boolean);
  49. {$ELSEC}
  50.     procedure AssertCode (b: boolean);
  51. {$ENDC}
  52.  
  53. {$endc}
  54.  
  55.  
  56. implementation
  57.  
  58. {$ifc do_debug}
  59. {$IFC not undefined THINK_PASCAL}
  60.     procedure Assert (b: boolean);
  61. {$ELSEC}
  62.     procedure AssertCode (b: boolean);
  63. {$ENDC}
  64.         begin
  65.             if not b then begin
  66.                 DebugStr('Assertion failed: notify casgrain@ere.umontreal.ca;sc;hc');
  67.             end;
  68.         end;
  69. {$endc}
  70.  
  71.         end.